(a). Field of the Invention
The present invention relates in general to data accessing of a storage medium, and more particularly to a data accessing apparatus and method that can employ a flag to indicate correctness of a data sector fetched from a storage medium of an optical electronic system.
(b). Description of the Prior Arts
Optical disc storage devices are among the most popular computer peripherals in recent years, and their technologies and associated specifications are making progress continuously. The digital video disc (DVD) as a new mainstream specification of optical disc storage is overwhelming and its application is getting more and more popular. Following the massive requirement to upgrade the accessing rate of DVD, it becomes a very important issue to simultaneously improve the accuracy of data accessing and secure an ideal cost/performance (C/P) ratio.
A brief description about the data format of DVD is provided below. First, a DVD data sector is composed of 2064 bytes, and its format is shown as FIG. 1. In FIG. 1, the DVD data sector includes 12 rows, and each row is 172 bytes long. The data sector includes in turn 4 bytes of ID, 2 bytes of ID Error Detection (IED) code, 6 bytes of Copyright Management Information (CPR_MAI), 2048 bytes of main data (D0-D2047), and 4 bytes of Error Detection Code (EDC). Wherein, the EDC is encoded in the form of Cyclic Redundancy Check (CRC) and used to detect the correctness of the data sector.
Second, in order to provide better data protection, a DVD data block is composed of 16 data sectors encoded in the form of Reed Solomon Product Code (RSPC), as shown in FIG. 2. In FIG. 2, the DVD data block contains 16 sectors, which total 192 (=12×16) rows and 172 columns, and the outer-code parity (PO) and inner-code parity (PI) data generated by the RSPC encoding. The PO data is generated column by column and 16 bytes long for each column, while the PI data is generated row by row and 10 bytes long for each of the 208 rows (including the 16 rows of PO data). Here the whole data block is processed as an error correction code (ECC) block, and the PO and PI data is the ECC for recovering data errors.
The conventional DVD technology employs the architecture of FIG. 3 to access data from a DVD disc. In FIG. 3, the data on a DVD disc 310 is fetched by a pick-up head 311 and transformed into row data 315 by an analog signal processor 312 and an EFMPLUS demodulator 314. The row data 315 is then stored into a memory 321 via a row data interface 316 by a memory controller 320. When the data stored in the memory 321 can form an ECC data block, a RSPC decoder 317 accesses the data block in the memory 321 by means of the memory controller 320, and decodes the PO and PI data therein to recover data errors. Next, an EDC processor 318 reads the data sectors in the data block and calculates the EDC of each data sector. If all the EDCs are correct, the main data of the data sectors are transferred to a host 322 via a host interface 319. Therefore, in the process of accessing a DVD data block, the PO and PI data corresponding to the data block are first decoded and corrected, and then the EDC of each data sector is verified to assure the correctness of the accessed data.
If any one of the 16 EDCs is incorrect, two common methods are applied. The first one re-performs the whole decoding and verification on the original accessed data block until all the EDCs are correct. The second one re-fetches the data block from the DVD disc, and decodes and verifies the re-fetched block. If there still is any incorrect data sector, the whole process (including re-fetching the block) is repeated until all the EDCs are correct. The above conventional methods have two main drawbacks: one is that the accessing frequency of the memory 321 is too high; the other is that re-fetching or re-decoding of the whole data block is needed to recover the data errors. These drawbacks would impact the DVD data-accessing rate and performance seriously.
R.O.C. Patent No. 88121259, entitled “DVD Data-Accessing Apparatus and Method”, provides some improvements for the above issues. Please refer to FIG. 4, which is the block diagram showing the improved apparatus of the patent. First, the data on a DVD disc 410 is fetched by a pick-up head 411 and transformed into row data 415 by an analog signal processor 412 and an EFMPLUS demodulator 414. Then, the improved apparatus decodes the PI data and generates the EDC of each data sector by means of a row data interface and first PI decoder 416, an EDC generator 417 and a row data buffer 418. The row data 415 is then stored into a memory 421. In this way, the load of memory accessing, resulted from the PI decoding and EDC calculation of the conventional technology, can be mitigated. Second, by means of the design of an EDC file 422, an EDC processor 424 and a RSPC decoder 426, the apparatus modifies the previously generated EDCs by using the error correction results at the same time as decoding the PO data and recovering errors. Last, if all the EDCs are correct, then the accessed data is transferred to a host 430 via a host interface 428. Besides, this patent also provides a data accessing method for re-reading a data block if all the EDCs therein are not correct. This method can skip the data sectors verified as correct when re-reading the data block, thereby improving the data-accessing efficiency.
However, the architecture of FIG. 4 needs extra hardware and complex circuits to achieve these improvements. Thus, the chip design is much more difficult, and the chip area and cost are also increased significantly. In view of this, the present invention provides an improved data accessing apparatus and method that can simplify the architecture of FIG. 4 while providing the same performance of data accessing.